from django.urls import path, re_path
from app1 import views

# todo  配置二级路由
urlpatterns = [
    path("index/", views.index, name="index"),
    path("demo01/", views.demo01, name="demo01"),
    path("demo02/", views.demo02, name="demo02"),
    path("demo03/", views.demo03, name="demo03"),
    path("demo_list/", views.demo_list, name="demo_list"),
    path("demo_dict/", views.demo_dict, name="demo_dict"),
    path("demo_obj/", views.demo_obj, name="demo_obj"),
    path("demo_list2/", views.demo_list2, name="demo_list2"),
    path("demo_empty/", views.demo_empty, name="demo_empty"),
    path("demo_filter1/", views.demo_filter1, name="demo_filter1"),

    path("getvalues/", views.getvalues, name="getvalues"),

    # path("book/<int:bookid>/", views.book, name="book"),  # <数据类型:变量名>
    # path("book/<str:bookname>/", views.book, name="book"),  #

    path("blog/", views.blog, name="blog"),  # 获取某一篇博客信息
    # /blog/?id=2
    path("login/", views.login, name="login"),

    # re_path(r'book1/(?P<bookid>[0-9]{4})',views.book1,name='book1')
    re_path(r'book1/(?P<bookid>\d{2,4})', views.book1, name='book1'),

    path("book/<path:bookname>/", views.book, name="book"),  # path>str>int
    path('demo_test/', views.demo_test, name='demo_test'),
    path('demo_extends/', views.demo_extends, name='demo_extends'),
    path('showimg/', views.showimg, name='showimg'),
    path('login2/', views.login2, name='login2'),
    path('downfile/<str:filename>', views.downfile, name='downfile'),

    path('orm_operation/', views.orm_operation, name='orm_operation'),
    path('info/', views.info, name='info'),
    path('collect_student_info/', views.collect_student_info, name='collect_student_info'),
    path('show_students/', views.show_students, name='show_students'),
    # http://127.0.0.1:8000/app1/student/5
    path('student/<int:student_id>', views.student, name='student'),
    # http://127.0.0.1:8000/app1/student2/?id=2
    path('student2/', views.student2, name='student2'),

    path('del_student/<int:student_id>', views.del_student, name='del_student'),
    path('del_student2/', views.del_student2, name='del_student2'),
    path('update_student/', views.update_student, name='update_student'),
    path('fun1/', views.fun1, name='fun1'),
    path('query_student/', views.query_student, name='query_student'),

]
